package com.qf.homework.service.impl;

import com.qf.homework.controller.entity.Category;
import com.qf.homework.dao.CategoryDao;
import com.qf.homework.dao.impl.CategoryDaoImpl;
import com.qf.homework.service.CategoryService;

import java.sql.SQLException;
import java.util.List;

public class CategoryServiceImpl   implements CategoryService {
    private CategoryDao categoryDao=new CategoryDaoImpl();

    @Override
    public List<Category> getCategoryList(int currentPage, int size) throws SQLException {
         if (currentPage<1){currentPage=1;}
        return categoryDao.getCategoryList((currentPage - 1)*size, size);

    }
}
